package bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

@Entity
@Table
@NamedQueries(value = { 
	@NamedQuery(name="Producer.findbyName", query="select p from Producer p where p.name =:producer"),
	@NamedQuery(name="Producer.findbyID", query="select p from Producer p where p.id =:id"),
	@NamedQuery(name="Producer.findAll", query="select p from Producer p")
})
public class Producer implements java.io.Serializable{
	private Long id;
	private String name;
	
	public Producer() {}
	
	public Producer(String name) {
		this.name = name;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(unique=true)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
}
